package com.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.demo.dao.DataInfoDao;
import com.demo.domain.DataInfo;

@RestController
public class Controller {

	@Autowired
	private DataInfoDao userDao;

    @GetMapping("/dao")
    public DataInfo dao(){
    	return userDao.selectById(1);
    }

    @GetMapping("/page")
    public Page<DataInfo> page(){
    	QueryWrapper<DataInfo> queryWrapper = new QueryWrapper<>();
    	queryWrapper.eq("domain", "mq_client_event");
    	return userDao.selectPage(new Page<DataInfo>(1, 1), queryWrapper);
    }

}